cmake_minimum_required(VERSION 3.12 FATAL_ERROR)
SET(CMAKE_CXX_STANDARD 17)
SET(CMAKE_CXX_STANDARD_REQUIRED ON)

PROJECT(Extra_Generate)
if(NOT DEFINED CMAKE_DEBUG_POSTFIX)
	SET(CMAKE_DEBUG_POSTFIX "_d")
endif()

include_directories(${CMAKE_SOURCE_DIR}/parserst)
file(GLOB extra_code ${CMAKE_SOURCE_DIR}/Split/*.h ${CMAKE_SOURCE_DIR}/Split/*.cpp)

file(GLOB op2_code
		${CMAKE_SOURCE_DIR}/parseop2/*.h
		${CMAKE_SOURCE_DIR}/parseop2/*.cpp
)
include_directories(${CMAKE_SOURCE_DIR}/Main/GeneralMethod.h)
add_executable(${PROJECT_NAME}
		${CMAKE_SOURCE_DIR}/Main/GeneralMethod.h
		${extra_code}
		${op2_code}
)
target_link_libraries(${PROJECT_NAME}
		${PYTHON_LIBS}
		ParseRST
)
# 将dll和lib放置到指定目录下
if(WIN32)
	set_target_properties(${PROJECT_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${WORK_ROOT_DIR})
	set_target_properties(${PROJECT_NAME} PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${WORK_ROOT_DIR})
	set_target_properties(${PROJECT_NAME} PROPERTIES ARCHIVE_OUTPUT_DIRECTORY ${WORK_ROOT_DIR})
else()
	set_target_properties(${PROJECT_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${WORK_DIR})
	set_target_properties(${PROJECT_NAME} PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${WORK_DIR})
	set_target_properties(${PROJECT_NAME} PROPERTIES ARCHIVE_OUTPUT_DIRECTORY ${WORK_DIR})
endif()